Functions for Visual Basic

Visual Basic uses a different set of calling and programming conventions than C and C++ use. Different structure and parameter definitions support the Visual Basic representation of strings and of structures, which in Visual Basic are called types. The following list describes how programming Simple MAPI Visual Basic applications differs from programming Simple MAPI C and C++ applications:

    Because the concept of a pointer is foreign to Visual Basic, developers use extra function parameters instead of the complex pointer structures used in C and C++.

    Because the Visual Basic MAPI functions are declared, it is not necessary to explicitly cast passed arguments using ByVal.

    An empty string in a string variable is equivalent to a NULL value.

    Arrays must be dynamically declared so that they are redimensioned when the Simple MAPI function is executed.

    Visual Basic manages memory, eliminating the need for calling the MAPIFreeBuffer function.

    All structures used in the Visual Basic version of Simple MAPI are Visual Basic types rather than C-language structures.

    All strings used in the Visual Basic version of Simple MAPI are Visual Basic strings rather than C-language strings.

 

The Simple MAPI functions for Visual Basic work with Visual Basic 3, Visual Basic 4, and Visual Basic for Applications. Note that slight differences in the 16-bit and 32-bit Visual Basic runtime DLLs mean that some Simple MAPI functions have different declarations depending on which runtime is being used. The 32-bit declarations use explicit Visual Basic array notation. The alternate declarations are documented with the functions that have them.